/*
file   : *.cpp
author : shentq
version: V1.0
date   : 2015/7/5

Copyright 2015 shentq. All Rights Reserved.
*/

//STM32 RUN IN eBox


/*
一个独立看门狗的示例程序
*/
#include "ebox.h"
#include "bsp_ebox.h"
/* 定义例程名和例程发布日期 */
#define EXAMPLE_NAME	"independent wdg example"
#define EXAMPLE_DATE	"2018-08-08"

E_WDG dog;


void setup()
{
    eboxInit();
		
    UART.begin(115200);
//    print_log(EXAMPLE_NAME, EXAMPLE_DATE);

    UART.printf("reset !!!\r\n");
		LED.mode(OUTPUT_PP_PU);
//		LED.set();
		delayMs(1000);
		LED.reset();
		
    dog.begin(26208);
}

void test(void)
{
    uint32_t current, i = 0;
    current = eboxGetMs();// millis();
    while(1)
    {
        dog.feed();//在常见的应用中喂狗应该在定时器中断中定时喂狗
        UART.printf("feed %d running %.02fs interval %.02f s!\r\n", i++, (gMs / 1000.0), (gMs - current) / 1000.0);
        current = eboxGetMs();
        delayMs(25020);
    }
}




